<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>游戏统计</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="{$Think.const.RESOURCE}css/font.css">
    <link rel="stylesheet" href="{$Think.const.RESOURCE}css/xadmin.css">
      <script type="text/javascript" src="__PUBLIC__/home/js/jquery-3.2.1.min.js"></script>
    <!--<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>-->
    <script type="text/javascript" src="{$Think.const.RESOURCE}lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="{$Think.const.RESOURCE}js/xadmin.js"></script>
  </head>
  
  <body class="layui-anim layui-anim-fadein">
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页/游戏统计</a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:39px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so" action="{:U('stats/brnn')}" method="post">
          <input class="layui-input" placeholder="时间" name="time" id="start"   value ="{$condi.time}" >
           <div class="layui-input-inline">
                <select name="gametype" lay-verify="" style="display: none;">
                    <volist name="ct" id="gt">
                        <option value="{$gt[1]}" <?php if($gt[1] == $condi['gametype']){echo "selected";}?> >{$gt[0]}</option>
                    </volist>
                </select>
          </div>  
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>
      </div>
        <table class="layui-table">
          <thead>
                <tr>
                  <th colspan="4"> </th>
                  <th>{$sum_bet}</th>
                  <th>{$sum_kj}</th>
                  <th>{$sum_tax}</th>
                  <th>{$sum_amount}</th>
              </tr>
              <tr>
                  <th ><span style="display: inline-block; min-width: 60px;">时间</span></th>
                  <th> 游戏房间</th>
                  <th>登陆人数</th>
                  <th style="">登陆次数</th>
                  <th ><span style="display: inline-block; min-width: 60px;color: #ac8f0f;">总下注金额</span></th>
                  <th ><span style="display: inline-block; min-width: 60px;color: #ac8f0f;">总开奖金额</span></th>
                  <th ><span style="display: inline-block; min-width: 60px;color: #ac8f0f;">总税收</span></th>
                  <th ><span style="display: inline-block; min-width: 60px;color: #ac8f0f;">总盈亏</span></th>
              </tr>
          </thead>
          <tbody id="nr">
              <input type="hidden" id="sertime" value="{$list['times']}">
              <input type="hidden" id="serid" value="{$list['serid']}">        
              <volist name="lists" id="vo" empty="暂无数据....">
                  <tr>
                      <th>{$vo.time}</th>
                      <th>{$vo.game}</th>
                      <th>{$vo.renshu}</th>
                      <th>{$vo.cishu}</th>
                      <th  style="color: #ac8f0f;"><if condition="$vo.bet neq ''">{$vo.bet}<else />0</if></th>
                      <th  style="color: #ac8f0f;"><if condition="$vo.kj neq ''">{$vo.kj}<else />0</if></th>
                      <th  style="color: #ac8f0f;"><if condition="$vo.tax neq ''">{$vo.tax}<else />0</if></th>
                      <th  style="color: #ac8f0f;"><if condition="$vo.amount neq ''">{$vo.amount}<else />0</if></th>
                      
                  </tr>
              </volist >

          </tbody>
      </table>
    </div>
    <script>
        layui.use('laydate', function(){
            var laydate = layui.laydate;
            //执行一个laydate实例
            laydate.render({
              elem: '#start' //指定元素
            });

            //执行一个laydate实例
            laydate.render({
              elem: '#end' //指定元素
            });
        });


       /* $(function () {
            var serverid= $("#serid").val();
            var serverids= serverid.split(",");
            times=$("#sertime").val();
            Loop_ajax(0,serverids);
        });

        function Loop_ajax(index, array) {
            if (index < array.length) { 
                var value = array[index];
                $.get("/stats/get_one_info", {time:times,severid:value},function (data) {
                        Abet=$("#Abetl").text();
                        Akj=$("#Akjl").text();
                        Atax=$("#Ataxl").text();
                        Aamount=$("#Aamountl").text();
                        $("#Abetl").text(Number(parseInt(data.bet))+Number(Abet));
                        $("#Akjl").text(Number(data.kj)+Number(Akj));
                        $("#Ataxl").text(Number(data.tax)+Number(Atax));
                        $("#Aamountl").text(Number(data.amount)+Number(Aamount));
                        $("#bet_"+data.servid+"").text(data.bet);
                        // $("#kj_"+data.servid+"").text(data.kj);
                        $("#kj_"+data.servid+"").text(parseInt(data.bet)-data.amount);
                        $("#tax_"+data.servid+"").text(data.tax);
                        $("#amount_"+data.servid+"").text(data.amount);
                        if (index < array.length) {
                            Loop_ajax(index + 1, array); 
                        }
                });
            }
        }*/
    </script>
  </body>
</html>